package org.example.spring_aop.proxy;

public class HouseProxy implements HouseSubject{
    private RealHouseSubject subject;
    public HouseProxy(RealHouseSubject subject){
        this.subject = subject;
    }
    @Override
    public void rent() {
        System.out.println("我是中介，我帮房东开始代理");
        subject.rent();
        System.out.println("我是中介，我帮房东结束代理");
    }

    @Override
    public void sale() {
        System.out.println("我是中介，我帮房东开始代理");
        subject.sale();
        System.out.println("我是中介，我帮房东结束代理");
    }
}
